<?php
include_once "common.php";
/*
	$_SESSION['login']['ID'] = 1;
	$_SESSION['login']['Firstname'] = "Martin";
	$_SESSION['login']['Lastname'] = "Buist";
	$_SESSION['login']['Email'] = "martin.buist@tincubegamestore.nl";
*/
?>
<script>
	function loginUser()
	{
		var username = $('#username').val();
		var password = $('#password').val();
		$.post(
			'<?=$hroot;?>/factory/loginUser.php',
			{ username: username, password: password },
			function(data) {
				if(data == 'succes')
				{
					window.location = window.location;
				}
				else
				{
					alert(data);
				}
			});	
	}
</script>
<div style="margin:100px auto; border:solid 1px #000; width:350px; text-align:center;">
	<h1>Login</h1>
	<table>
		<tr>
			<td align="left">
				Username
			</td>
			<td>
				:
			</td>
			<td align="left">
				<input type="text" id="username" />
			</td>
		</tr>
		<tr>
			<td align="left">
				Password
			</td>
			<td>
				:
			</td>
			<td align="left">
				<input type="password" id="password" />
			</td>
		</tr>
		<tr>
			<td colspan="3" align="right">
				<input type="button" value=" Login " onClick="javascript: loginUser();" />
			</td>
		</tr>
	</table>
</div>